from pyzbar.pyzbar import decode
from PIL import Image
import json

image_path1 = 'Data/QR_Data/example.png'


def scan_qr_code(image_path):
    image = Image.open(image_path)
    decoded_objects = decode(image)
    product_data = []
    for obj in decoded_objects:
        product_data.append(obj.data.decode('utf-8'))
    return product_data[0]

